how to wait in node js for loop